﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using FreeSql.DataAnnotations;

namespace shop.Model
{

    /// <summary> 运费报价 </summary>
    public class PostPrice
    {
        /// <summary>  </summary>
        [Column(IsPrimary = true, IsIdentity = true)]
        public int Id { get; set; }

        ///  <summary> 仓库或店铺 </summary>
        [Column(StringLength = 100)]
        public string shop_name { set; get; }

        ///  <summary> 省份 </summary>
        [Column(StringLength = 4000)]
        public string provinceJson { set; get; }

        ///  <summary> 城市 </summary>
        [Column(StringLength = 100)]
        public string city { set; get; }

        ///  <summary> 县区 </summary>
        [Column(StringLength = 100)]
        public string county { set; get; }

        ///  <summary> 物流公司 </summary>
        [Column(StringLength = 100)]
        public string logistics_name { set; get; }


        ///  <summary> 仓库 </summary>
        [Column(StringLength = 4000)]
        public string StockJson { set; get; }


        ///  <summary> 最优重量上限 </summary>
        [Column(Precision = 18, Scale = 4)]
        public decimal maxWeight { set; get; }

        /// <summary> 特殊重量区间,特殊区间邮资  </summary>
        [Column(StringLength = 4000)]
        public string SpecialRangeJson { set; get; }


        /// <summary> 重量区间,续重,区间邮资  </summary>
        [Column(StringLength = 4000)]
        public string CommonRangeJson { set; get; }



        /////  <summary> 特殊重量区间1 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange1 { set; get; }

        /////  <summary> 特殊区间1邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice1 { set; get; }

        /////  <summary> 特殊重量区间2 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange2 { set; get; }

        /////  <summary> 特殊区间2邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice2 { set; get; }

        /////  <summary> 特殊重量区间3 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange3 { set; get; }

        /////  <summary> 特殊区间3邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice3 { set; get; }

        /////  <summary> 特殊重量区间4 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange4 { set; get; }

        /////  <summary> 特殊区间4邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice4 { set; get; }

        /////  <summary> 特殊重量区间5 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange5 { set; get; }

        /////  <summary> 特殊区间5邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice5 { set; get; }

        /////  <summary> 特殊重量区间6 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange6 { set; get; }

        /////  <summary> 特殊区间6邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice6 { set; get; }

        /////  <summary> 特殊重量区间7 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange7 { set; get; }

        /////  <summary> 特殊区间7邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice7 { set; get; }

        /////  <summary> 特殊重量区间8 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spWeightRange8 { set; get; }

        /////  <summary> 特殊区间8邮资 </summary>
        //[Column(Precision = 18, Scale = 4)]
        //public decimal spPrice8 { set; get; }

        ///  <summary> 首重 </summary>
        [Column(Precision = 18, Scale = 4)]
        public decimal firstWeight { set; get; }

        /// <summary> 首重资费 </summary>
        [Column(Precision = 18, Scale = 4)]
        public decimal firstWeightPrice { set; get; }


        /// <summary> 最低收费 </summary>
        [Column(Precision = 18, Scale = 4)]
        public decimal MinAmount { set; get; }


        /////  <summary> 重量区间1 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal weightRange1 { set; get; }

        /////  <summary> 续重单位1 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitWeight1 { set; get; }

        /////  <summary> 单位资费1 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitPrice1 { set; get; }

        /////  <summary> 重量区间2 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal weightRange2 { set; get; }

        /////  <summary> 续重单位2 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitWeight2 { set; get; }

        /////  <summary> 单位资费2 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitPrice2 { set; get; }

        /////  <summary> 重量区间3 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal weightRange3 { set; get; }

        /////  <summary> 续重单位3 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitWeight3 { set; get; }

        /////  <summary> 单位资费3 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitPrice3 { set; get; }

        /////  <summary> 重量区间4 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal weightRange4 { set; get; }

        /////  <summary> 续重单位4 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitWeight4 { set; get; }

        /////  <summary> 单位资费4 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal unitPrice4 { set; get; }

        ///  <summary> 取整方式 </summary>
        [Column(StringLength = 30)]
        public string roundMode { set; get; }

        ///  <summary> 抛重比 </summary>
        [Column(Precision = 18, Scale = 4)]
        public decimal weightRatio { set; get; }


        ///// <summary> 按件计费单价 </summary>
        //[Column(Precision =18, Scale =4)]
        //public decimal PriceByQty { set; get; }


        ///// <summary> 计算策略 </summary>
        //[Column(StringLength =50)]
        //public string CalcMethod { get; set; }  

        public DateTime? BeginDate { set; get; }

        public DateTime? EndDate { set; get; }

        public bool isdel { set; get; }


        public DateTime FTime { set; get; }

        [Column(StringLength = 30)]
        public string FUser { set; get; }


        [Column(StringLength = 100)]
        public string batch { get; set; }

        public virtual PostPrice Clone()
        {
            return this.MemberwiseClone() as PostPrice;
        }
    }


    public class PostPriceDto:PostPrice
    {
        public List<SpecialRange> SpceialRangeList { set; get; }
        
        
        public string SpceialRangeDto { set; get; }

        public string SpceialRangePriceDto { set; get; }

        public string CommonRangeDisplay { set; get; }


        public List<SpecialRange> CommonRangeList { set; get; }



        public string WeightRangeDto { set; get; }
        
        public string UnitWeightDto { set; get; }   

        public string UnitWeightPriceDto { set; get; }



        //public string WeightRangeDto2 { set; get; }

        //public string UnitWeightDto2 { set; get; }

        //public string UnitWeightPriceDto2 { set; get; }


        public new PostPriceDto Clone()
        {
            return this.MemberwiseClone() as PostPriceDto;
        }

    }

    /// <summary> 区间 </summary>
    public class SpecialRange
    {
        public decimal WeightRange { get; set; }
        public decimal UnitWeight { get; set; }
        public decimal Price { get; set; }
    }

}
